package org.openems.osa;

import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;

import javax.swing.JFrame;

public class SwingFrame implements IFrame {
	private JFrame frame = new JFrame();
	
	@Override
	public void setSize(Dimension dimension) {
		frame.setSize(dimension);
	}

	@Override
	public void setVisible(boolean b) {
		frame.setVisible(b);
	}

	@Override
	public void setDefaultCloseOperation(int exitOnClose) {
		frame.setDefaultCloseOperation(exitOnClose);
	}

	@Override
	public void setLayout(FlowLayout flowLayout) {
		frame.getContentPane().setLayout(flowLayout);
	}

	@Override
	public void add(IPanel component) {
		frame.getContentPane().add((Component)component.getUi());
	}

	@Override
	public void doLayout() {
		frame.getContentPane().doLayout();
	}

}
